package com.world.rickcloudendpoint.common.constant;

/**
 * 错误返回码枚举类
 */
public class ErrorCodes {


    /**
     * 应用包中交互式界面错误,第8位为1
     */
    public static int ApplicationUi = 10000000;

    /**
     * 应用包中后台服务端错误,第8位为2
     */
    public static int ApplicationServer = 20000000;

    /**
     * 框架层错误,第8位为3
     */
    public static int Framework = 30000000;

    /**
     * 数据引擎错误,第8位为4
     */
    public static int DataEngine = 40000000;

    public static int getApplicationUi(int componentCode, int detailCode) {
        return ApplicationUi + componentCode * 1000 + detailCode;
    }

    public static int getApplicationUi(int detailCode) {
        return getApplicationUi(0, detailCode);
    }

    public static int getApplicationServer(int componentCode, int detailCode) {
        return ApplicationServer + componentCode * 1000 + detailCode;
    }

    public static int getApplicationServer(int detailCode) {
        return getApplicationServer(0, detailCode);
    }

    public static int getFramework(int componentCode, int detailCode) {
        return Framework + componentCode * 1000 + detailCode;
    }

    public static int getFramework(int detailCode) {
        return getFramework(0, detailCode);
    }

    public static int getDataEngine(int componentCode, int detailCode) {
        return DataEngine + componentCode * 1000 + detailCode;
    }

    public static int getDataEngine(int detailCode) {
        return getDataEngine(0, detailCode);
    }


}
